<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
	  <t:datagrid name="deviceApplyList"  fitColumns="true" title="活动借用设备审核" actionUrl="activityBorrowController.do?auditDatagrid" idField="id" fit="true" >
	  <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
	  <t:dgCol title="状态值"  field="applyStateValue"  hidden="true"  queryMode="single" width="80" ></t:dgCol> 
	  <t:dgCol title="创建日期"  field="createDate" formatter="yyyy-MM-dd"   queryMode="single"  width="120"></t:dgCol>
	  <t:dgCol title="申请人"  field="applyUser.realName" queryMode="single"  width="120"></t:dgCol>
	  <t:dgCol title="申请日期"  field="applyDate" formatter="yyyy-MM-dd"   queryMode="single"  width="120"></t:dgCol>
	  <t:dgCol title="设备信息"  field="deviceInfo"    queryMode="single"  width="120"></t:dgCol>
	  <t:dgCol title="开始使用"  field="beginUseDate" formatter="yyyy-MM-dd"   queryMode="single"  width="120"></t:dgCol>
	  <t:dgCol title="结束使用"  field="endUseDate" formatter="yyyy-MM-dd"   queryMode="single"  width="120"></t:dgCol>
	  <t:dgCol title="领用日期"  field="receiveDate" formatter="yyyy-MM-dd"   queryMode="single"  width="120"></t:dgCol>
	  <t:dgCol title="预约说明"  field="remark"    queryMode="single"  width="120"></t:dgCol>
	  <t:dgCol title="申请状态"  field="applyState.name"    queryMode="single"  width="120"></t:dgCol>
	  <t:dgCol title="是否删除"  field="isDeleted" hidden="true"  queryMode="single"  width="120"></t:dgCol>
	  <t:dgCol title="操作" field="opt" width="130"></t:dgCol>
	  <t:dgFunOpt funname="passApply(id)" title="通过"></t:dgFunOpt> 
	  <t:dgFunOpt funname="fialPassApply(id)" title="不通过"></t:dgFunOpt> 
<%-- 	  <t:dgToolBar title="查看" icon="icon-search" url="deviceAppointApplyController.do?goUpdate" funname="detail"></t:dgToolBar>  --%>
  </t:datagrid>
  </div>
 </div>
 <script type="text/javascript"> 
	function passApply(id){
		$.dialog.confirm('确定要审核通过吗?', function(r) {
			   if (r) { 
					$.ajax({
						url : 'activityBorrowController.do?doAudit&result=1&id='+id,
						type : 'post', 
						cache : false,
						success : function(data) {
							var d = $.parseJSON(data);
							if (d.success) {
								var msg = d.msg;
								tip(msg);
								reloadTable(); 
							}else{
								tip(msg);
							}
						}
					});
				}
			}); 
	}
	
	function fialPassApply(id){
		$.dialog.confirm('确定要审核不通过吗?', function(r) {
			   if (r) { 
					$.ajax({
						url : 'activityBorrowController.do?doAudit&result=0&id='+id,
						type : 'post', 
						cache : false,
						success : function(data) {
							var d = $.parseJSON(data);
							if (d.success) {
								var msg = d.msg;
								tip(msg);
								reloadTable(); 
							}else{
								tip(msg);
							}
						}
					});
				}
			}); 
	}
 </script>